<!DOCTYPE html>
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <title>系统用户账号</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link th:href="@{../assets/css/page.css}" rel="stylesheet"/>
    <link th:href="@{../assets/libs/nice-validator/dist/jquery.validator.css}" rel="stylesheet"/>
    <script type="text/javascript" th:src="@{../assets/libs/jquery/dist/jquery.js}"></script>
    <script type="text/javascript" th:src="@{../assets/libs/nice-validator/dist/jquery.validator.js}"></script>
    <script type="text/javascript" th:src="@{../assets/libs/nice-validator/dist/local/zh-CN.js}"></script>
    <script type="text/javascript" th:src="@{../assets/js/login/jquery.md5.js}"></script>
    <script type="text/javascript" th:src="@{../assets/js/login/jquery.tips.js}"></script>
    <script type="text/javascript" th:src="@{../assets/js/page.js}"></script>
    <!--[if lt IE 9]>
    <script th:src="@{../assets/js/html5shiv.js}"></script>
    <script th:src="@{../assets/js/respond.min.js}"></script>
    <![endif]-->
    <script type="text/javascript">
        $(function () {
            $.ajax({
                url:'../role/pageQuery',
                type:"get",
                dataType:"json",
                success:function (result) {
                    var html="";
                    $.each(result.rows,function (i,item) {
                        html += "<option value="+item.cname+">"+item.cname+"</option>";
                    })
                    $("#crolename").html(html);
                    $("#croleeng").val(result.rows[0].crolename);
                },
                error:function (error) {

                }
            })
            
            $("#crolename").change(function () {
                var role = $("#crolename").val();
                $.ajax({
                    url:'../role/findOneByVO',
                    type:"post",
                    dataType:"json",
                    data:{"cname":role},
                    success:function (result) {
                        $("#croleeng").val(result.crolename);
                    },
                    error:function (error) {

                    }
                })
            })

        })

        function subSubmitHandler() {
            var password = jQuery.md5($("#cloginpwd").val());
            $("#cloginpwd").val(password);
            $("#creloginpwd").val(password);
        }
    </script>
</head>
<body class="inside-header inside-aside is-dialog">
<div id="main" role="main">
    <div class="tab-content tab-addtabs">
        <div id="content">
            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                    <div class="content">
                        <form id="edit-form" class="form-horizontal form-ajax" role="form" data-toggle="validator" method="POST" action="./addItem">
                            <!--<input id="iid" name="iid" type="hidden"/>-->
                            <div class="form-group">
                                <label for="cloginname" class="control-label col-xs-12 col-sm-2">登录账号:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="cloginname" name="cloginname" value="" autocomplete="off" data-rule="用户名:required"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="cloginpwd" class="control-label col-xs-12 col-sm-2">登录密码:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="password" class="form-control" id="cloginpwd" name="cloginpwd" value="" data-rule="密码:required;password"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="creloginpwd" class="control-label col-xs-12 col-sm-2">再次输入登录密码:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="password" class="form-control" id="creloginpwd" name="creloginpwd" value="" data-rule="确认密码: required;match(cloginpwd);"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="iuseable" class="control-label col-xs-12 col-sm-2">是否可用:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <!--<input type="text" class="form-control" id="iuseable" name="iuseable" value="" data-rule="required"/>-->
                                    <select name="iuseable" id="iuseable" class="form-control">
                                        <option value="1">可用</option>
                                        <option value="0">不可用</option>
                                    </select>
                                </div>
                            </div>
                            <!--<div class="form-group">
                                <label for="croleeng" class="control-label col-xs-12 col-sm-2">角色英文:</label>
                                <div class="col-xs-12 col-sm-8">
                                </div>
                            </div>-->
                            <div class="form-group">
                                <label for="crolename" class="control-label col-xs-12 col-sm-2">角色名称:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="hidden" class="form-control" id="croleeng" name="croleeng" value="" data-rule="required"/>
                                    <!--<input type="text" class="form-control" id="crolename" name="crolename" value="" data-rule="required"/>-->
                                    <select id="crolename" name="crolename" class="form-control">

                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="cname" class="control-label col-xs-12 col-sm-2">账号别名:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="cname" name="cname" value="" autocomplete="off"/>
                                </div>
                            </div>
                            <!--<div class="form-group">
                                <label for="ideptid" class="control-label col-xs-12 col-sm-2">隶属部门ID:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="ideptid" name="ideptid" value="" data-rule="required"/>
                                </div>
                            </div>-->
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2"></label>
                                <div class="col-xs-12 col-sm-8 text-center">
                                    <button type="submit" class="btn btn-success btn-embossed">确定</button>
                                    <button type="reset" class="btn btn-default btn-embossed">重置</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" th:src="@{../assets/libs/bootstrap/dist/js/bootstrap.js}"></script>
<script type="text/javascript" th:src="@{../assets/libs/toastr/toastr.js}"></script>
<script type="text/javascript" th:src="@{../assets/libs/layer/src/layer.js}"></script>
<script type="text/javascript" th:src="@{../assets/libs/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js}"></script>
<script type="text/javascript" th:src="@{../assets/libs/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js}"></script>


</body>
</html>

